<template>
  <div class="app-container">
    <el-form ref="form" :model="data" label-width="80px">
      <el-form-item label="id">
        <div>{{data.id}}</div>
      </el-form-item>
      <el-form-item label="仓库名称">
        <div>{{data.storageName}}</div>
      </el-form-item>
      <el-form-item label="二级仓库名字">
        <div>{{data.roomName}}</div>
      </el-form-item>
      <!--<el-form-item label="仓库别称">
        <div>{{data.shortName}}</div>
      </el-form-item>
      <el-form-item label="联系人">
        <div>{{data.contactName}}</div>
      </el-form-item>-->


      <el-form-item label="仓库状态">
        <div>{{data.status|statusName()}}</div>
      </el-form-item>
      <el-form-item label="创建时间">
        <div>{{data.createTime}}</div>
      </el-form-item>


    </el-form>
  </div>

</template>

<script>
import {roomDetail,} from "../../api/room";

export default {
  name: "detail",
  data(){
    return{
      data:{}
    }
  },
  filters: {
    statusName(status) {
      if (status===1) {
        return '正常';
      }else{
        return '异常'
      }
    }
  },
  created() {
    this.getDetail(this.$route.query.id)
  },
  methods:{
    getDetail(id){
      roomDetail({id:id}).then(response => {
        this.data = response.data.data
      })
    }
  }

}
</script>

<style scoped>

</style>
